﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Marbles.Core.Connectors
{
    public class Command
    {
        public string CommandText { get { return _cmdtext; } set { _cmdtext = value; } }
        public Dictionary<string, object> Parameters { get { return _parameters; } set { _parameters = value; } }

        private Dictionary<string, object> _parameters = null;
        private string _cmdtext = string.Empty;

        public Command(string CommandText)
        {
            _parameters = new Dictionary<string, object>();
            _cmdtext = CommandText;
        }

        public Command()
        {
            _parameters = new Dictionary<string, object>();
            _cmdtext = string.Empty;
        }

        public void AddParameter(string key, object value)
        {
            if (_parameters.ContainsKey(key))
            {
                _parameters[key] = value;
            }
            else
            {
                _parameters.Add(key, value);
            }
        }

    }
}